home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus Special 13 / AMIGAplus Sonderheft 13 (1998)(ICP)(DE)[!].iso / rexx / checkfiles.vzrx < prev    next >
Text File  |  1998-03-01  |  2KB  |  66 lines

  1. /*
  2.    $VER: CheckFiles.vzrx 1.00 (28.2.98)
  3.          © 1998 by Georg Hörmann
  4.          Idea by Ramiro Garcia
  5.  
  6.    Template: CheckFiles.vzrx FILE1/A,FILE2/K,FILE3/K,...,QUIT/S
  7.  
  8.       FILE1, FILE2, FILE3, etc.:
  9.             Must be one or more valid filenames (with path).
  10.       QUIT: If VirusZ has been started from the script, you can
  11.             quit after checking by specifying this option.
  12.  
  13.    If VirusZ is not running, it will be started from the
  14.    script (and quitted afterwards if requested).
  15. */
  16.  
  17. Prog_VirusZ = "dh0:VZ" /* You may change this */
  18.  
  19. options results
  20. options failat 99
  21.  
  22. UseQuitFlag = "no"
  23.  
  24. parse upper arg list
  25. if list = "" then do
  26.     say "No files specified."
  27.     exit
  28.     end
  29.  
  30. k=0                    /* Break up the argument into a list of files */
  31. DO UNTIL list = ""
  32.     PARSE VAR list kthword.k list
  33.     k=k+1
  34.     END
  35.  
  36. if ~show(ports,VIRUSZ_II.REXX) then do
  37.     say "Starting VirusZ..."
  38.     address command Prog_VirusZ
  39.     UseQuitFlag = "yes"
  40.     StartTime = time(seconds)
  41.     do while ~show(ports,VIRUSZ_II.REXX)
  42.         if time(seconds) - StartTime > 20 then do
  43.             say "Error loading VirusZ!"
  44.             exit
  45.             end
  46.         end
  47.     end
  48.  
  49. Q=k-1                    /* Check for presence of QuitFlag */
  50. QuitFlag = kthword.Q
  51. if QuitFlag = "QUIT" then COUNTER = k-2; else COUNTER = k-1
  52.  
  53. DO n=0 to COUNTER            /* Check the files vor viruses */
  54.     address VIRUSZ_II.REXX CHECKFILE kthword.n DECREXEC DECRDATA
  55.     if rc=0 then say "File '"kthword.n"' is clean."
  56.     if rc=5 then say "File '"kthword.n"' contains virus!"
  57.     if rc=10 then say "Error checking file '"kthword.n"'!"
  58.     END
  59.  
  60. if UseQuitFlag = "yes" then do
  61.     if QuitFlag = "QUIT" then do
  62.         say "Quitting VirusZ..."
  63.         address VIRUSZ_II.REXX QUIT
  64.         end
  65.     end
  66.